<?php $objResultado = $view->result;?>

<div class="container">
    <div class="row">
        <div class="view-news"  style="width: 50%;">
            <div class="col-md-9">
                <div class="view-news-tt"  style="font-size: 1em ;margin-bottom: 0px; ">
                    Resultado da busca para "<?= $_GET["title"]?>"
                </div>
            </div>
        </div>
        
<?php

foreach($objResultado as $objNode){
    $data_criacao = format_date($objNode->node_created, 'chamadas_blogs');
    $title        = $objNode->node_title;
    $url_link = drupal_get_path_alias('node/'.$objNode->nid);
    $strBody = trim($objNode->field_body[0]["rendered"]["#markup"]);
    $strTipo = strtoupper($objNode->_field_data["nid"]["entity"]->type);
    $tipo = $objNode->_field_data['nid']['entity']->type;
    
    if($tipo == 'empreendimento'){
        $uri_img_teaser = $objNode->_field_data['nid']['entity']->field_imagem_teaser['und'][0]['uri'];
    }else{
        $uri_img_teaser = $objNode->_field_data['nid']['entity']->field_image['und'][0]['uri'];
    }
    
    if(!empty($uri_img_teaser)){
        $uri_img_teaser = $objNode->_field_data['nid']['entity']->field_image['und'][0]['uri'];
        $url_img_teaser = image_style_url("260_80",$uri_img_teaser);
    }else{
        $url_img_teaser = path_to_theme().'/images/no-picture.png';
    }
?>

    <div class="col-md-9">
                <div class="view-news">
                    <div class="col-md-4">
                        <a href="<?= $url_link ?>">
                            <img typeof="foaf:Image" src="<?php print $url_img_teaser;?>" width="260" height="280">
                        </a>
                    </div>
                    <div class="col-md-5">
                        <div class="date"> <?php print $data_criacao;?> - <?= $strTipo ?> </div>
                        <div class="view-news-tt"  style="font-size: 1em ;margin-bottom: 0px; "><a class="view-news-tt" href="<?= $url_link ?>" style="font-size: 1em ;margin-bottom: 0px; "><?php print $title;?></a></div>
                        <div class="view-news-information">
                            <?= $strBody ?>
                        </div>

                        <div class="tags">
                            <?php print render($content['field_tags']); ?>
                        </div>
                    </div>
                </div>
    
</div>
<?php
}
?>
            </div>
</div>

<div class="container">
    <div class="row">
        <div class="view-news" style="width: 50%;">
            <div class="col-md-12">
                <?php
                   if ($pager):
                       print $pager;
                   endif; 
                ?>
            </div>
        </div>
    </div>
</div>
